package pannelli.sub;
import com.cloudgarden.layout.AnchorConstraint;
import com.cloudgarden.layout.AnchorLayout;

import java.awt.Dimension;
import javax.swing.BorderFactory;

import javax.swing.WindowConstants;
import javax.swing.JFrame;
import javax.swing.JTextField;

import oggetti.Utente;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class SubPannelloUtente extends javax.swing.JPanel {
	private JTextField username;
	private JTextField mail;
	private JTextField cognome;
	private JTextField nome;
	private JTextField password;

	public SubPannelloUtente() {
		super();
		initGUI();
	}
	public Utente getUtenteFromFields(){
		return new Utente(username.getText(),password.getText(),nome.getText(),cognome.getText(),mail.getText());
	}
	
	private void initGUI() {
		try {
			AnchorLayout thisLayout = new AnchorLayout();
			this.setLayout(thisLayout);
			this.setPreferredSize(new java.awt.Dimension(351, 169));
			{
				mail = new JTextField();
				this.add(mail, new AnchorConstraint(677, 967, 961, 18, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				mail.setPreferredSize(new java.awt.Dimension(333, 48));
				mail.setBorder(BorderFactory.createTitledBorder("E-Mail"));
			}
			{
				cognome = new JTextField();
				this.add(cognome, new AnchorConstraint(411, 967, 642, 519, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				cognome.setPreferredSize(new java.awt.Dimension(157, 39));
				cognome.setBorder(BorderFactory.createTitledBorder("Cognome"));
			}
			{
				nome = new JTextField();
				this.add(nome, new AnchorConstraint(411, 480, 642, 18, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				nome.setPreferredSize(new java.awt.Dimension(162, 39));
				nome.setBorder(BorderFactory.createTitledBorder("Nome"));
			}
			{
				password = new JTextField();
				this.add(password, new AnchorConstraint(44, 967, 340, 514, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				password.setPreferredSize(new java.awt.Dimension(159, 50));
				password.setBorder(BorderFactory.createTitledBorder("Password"));
			}
			{
				username = new JTextField();
				this.add(username, new AnchorConstraint(44, 480, 340, 18, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
				username.setPreferredSize(new java.awt.Dimension(162, 50));
				username.setBorder(BorderFactory.createTitledBorder("Username"));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	public void fillFields(Utente u){
		this.username.setText(u.getUsername());
		this.password.setText(u.getPassword());
		this.cognome.setText(u.getCognome());
		this.nome.setText(u.getNome());
		this.mail.setText(u.getEmail());
	}

}
